package cn.itcast.nems.oldems.dto.oldapi;

import lombok.Builder;
import lombok.Data;

/**
 * author liyong
 * create: 2024-03-13 18:03:58
 **/
@Data
@Builder
public class EmsApiResult {
    /**
     * 调用是否成功
     */
    private boolean success;
    /**
     * 错误信息(如果调用失败)
     */
    private String errorMessage;

    /**
     * 返回的结果
     */
    private String resultObject;

    public static EmsApiResult SUCCESS = EmsApiResult.builder().success(true).build();

    public static EmsApiResult fail(String errorMessage) {
        return EmsApiResult.builder().success(false).errorMessage(errorMessage).build();
    }
}
